1. Technical Field
The present disclosure relates to tracking and managing usage of resources consumed by processes and, more specifically, to tracking and managing resource usage through a ledger process that can trigger complex real-time reactions.
2. Introduction
Resource usage tracking is a feature common to many operating systems. These accounting systems can keep track of a variety of information, such as a process identifier, an elapsed time, and/or a number of blocks of I/O the process performed. However, these accounting features are designed to record the resources consumed by a process after the fact. Furthermore, the accounting features must be enabled explicitly. Therefore, if the system is not instructed ahead of time to track resource usage, accounting information will not be available. The requirement to enable resource usage tracking can be a significant drawback in situations where a system has exhibited poor performance for a period of time and a user or a process within the system wants to investigate but the resource tracking feature had not been enabled.
Additionally, many operating systems include features for controlling or limiting the consumption of resources. For example, the Unix system call setrlimit can be used to set a variety of limits including the amount of memory a process consumes, the number of files a process can have open, or the amount of CPU a process can consume. However, the set of resources that can be controlled are limited, and cannot be extended.
In operating systems that include resource consumption controlling features, when a process attempts to exceed a specified limit, the system will respond by sending the process a signal. The specific signal may depend on the resource being consumed, but in most cases the signal is a SIGSEGV. While it is theoretically possible to recover from this type of failure, it is sufficiently impractical that most processes are not able do so. Therefore, any failed allocation of a limited resource will result in the immediate death of the application.